//
//  AboutMeController.m
//  ios-supplier
//
//  Created by feynmanyuan on 15/5/16.
//  Copyright (c) 2015年 feynmanyuan. All rights reserved.
//

#import "AboutMeController.h"
#define screen_Width [UIScreen mainScreen].bounds.size.width
#define screen_Height [UIScreen mainScreen].bounds.size.height
@interface AboutMeController ()<UIGestureRecognizerDelegate>

@end

@implementation AboutMeController
- (void)viewDidLoad {
    [super viewDidLoad];
    
    if( IS_OS_7_OR_LATER ) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    //图片
    self.view.backgroundColor = [UIColor whiteColor];
    UIImageView *appImage = [[UIImageView alloc]initWithFrame:CGRectMake(screen_Width/2-40, 30, 80, 80)];
    appImage.image = [UIImage imageNamed:@"矢量智能对象-拷贝-2"];
    [self.view addSubview:appImage];
    //当前版本
    UILabel *banBen = [[UILabel alloc]initWithFrame:CGRectMake(screen_Width/2-35, 120, 70, 20)];
    banBen.text = @"版本v2.2";
    banBen.textColor = [UIColor grayColor];
    banBen.backgroundColor = [UIColor clearColor];
    banBen.textAlignment = NSTextAlignmentCenter;
    banBen.font = [UIFont systemFontOfSize:14.0f];
    [self.view addSubview:banBen];
    //公司
    UILabel *companyLabel = [[UILabel alloc]initWithFrame:CGRectMake(screen_Width/2-80, 145, 160, 20)];
    companyLabel.text = @"北京聚方便科技有限公司";
    companyLabel.textColor = [UIColor grayColor];
    companyLabel.backgroundColor = [UIColor clearColor];
    companyLabel.textAlignment = NSTextAlignmentCenter;
    companyLabel.font = [UIFont systemFontOfSize:14.0f];
    [self.view addSubview:companyLabel];
    
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
    
    [self.navigationItem setLeftBarButtonItem: [self createBackView]];
}
- (UIBarButtonItem *)createBackView
{
    UIButton *leftButtonItem = [UIButton buttonWithType:UIButtonTypeCustom];
    
    leftButtonItem.frame = CGRectMake(0, 0, 11, 20);
    
    [leftButtonItem setBackgroundImage:[UIImage imageNamed:@"icon-Back"] forState:UIControlStateNormal];
    
    [leftButtonItem setImageEdgeInsets: UIEdgeInsetsMake((19 - 11) / 2, 0, (19 - 11) / 2, 0)];
    
    [leftButtonItem addTarget:self action:@selector(leftButtonItemClicked) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem * item = [[UIBarButtonItem alloc] initWithCustomView:leftButtonItem];
    
    return item;
}

-(void)leftButtonItemClicked
{
    [self.navigationController popViewControllerAnimated:YES];
}

@end
